﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gnosis.Alexandria.Model
{
    public abstract class NamedHashedAbbreviatedBase
        : NamedHashedBase, IAbbreviated
    {
        private string _abbreviation = string.Empty;

        protected override void InitializeField(string fieldName, object value)
        {
            if (fieldName == "Abbreviation")
                _abbreviation = (string)value ?? string.Empty;
            else base.InitializeField(fieldName, value);
        }

        #region IAbbreviated Members

        public string Abbreviation
        {
            get { return _abbreviation; }
            set
            {
                if (_abbreviation != value)
                {
                    _abbreviation = value;
                    AddChange("Abbreviation", value);
                }
            }
        }

        #endregion
    }
}
